/*
 * Copyright (c) 2017 22420103@QQ.COM 版权所有
 */
package com.lehe.common.exceptions;


import com.lehe.common.MessageEnumDto;

/**
 * 平台的异常基础类型。
 *
 * @author 王丹
 * @since 2017-02-22
 */
public class LHException extends Exception {

    private static final long serialVersionUID = 1L;
    /** 错误码 */
    private String errorCode;

    public LHException() {

        super();
    }

    public LHException(String msg) {

        super(msg);
    }

    public LHException(String msg, Throwable t) {

        super(msg, t);
    }

    public LHException(String errorCode, String msg) {

        this(msg);
        this.errorCode = errorCode;
    }

    public LHException(String errorCode, String msg, Throwable t) {

        this(msg, t);
        this.errorCode = errorCode;
    }

    public LHException(MessageEnumDto messageEnum) {

        this(messageEnum.getMessageValue());
        this.errorCode = messageEnum.getMessageCode();
    }

    public String getErrorCode() {

        return errorCode;
    }

    public void setErrorCode(String errorCode) {

        this.errorCode = errorCode;
    }
}
